﻿@{
    System.Data.DataTable kpiActData = ViewBag.KpiActData;
    System.Data.DataTable kpiActDataGroup = ViewBag.KpiActDataGroup;
    System.Data.DataTable kpiLastYearDe = ViewBag.KpiLastYearDe;
    string vb_month = ViewBag.Month;
    if (kpiActData.Rows.Count == 0)
    {
        ViewBag.TdWidth = "100%";
        ViewBag.TdHeigth = "500px";
    }
    else
    {
        ViewBag.TdHeigth = "580px";
    }
    <div id="KpiActDataTd" style="text-align: center; width: @ViewBag.TdWidth; height:@ViewBag.TdHeigth;">
        @{
            if (kpiActData.Rows.Count > 0)
            {
                <table style="width: 100%; border-left: 1px solid #507cd1; border-right: 1px solid #507cd1;">
                    <thead style="position:sticky;top:0;">
                        <tr style="background-color: #507cd1; font-size: 18px; color: white; font-weight: bold; height: 40px;">
                            <td hidden="hidden">KPI_ID</td>
                            <td hidden="hidden">PERIOD_TYPE</td>
                            <td width="60"><input id="kpititlecheck" type="checkbox" aria-label="kpititlecheck" onchange="kpititelcheckChange(event)" /></td>
                            @*<td width="80">域</td>*@
                            <td width="60">年度</td>
                            <td width="60">NO</td>
                            <td width="150">流程</td>
                            <td width="150">績效指標</td>
                            <td width="150">公式</td>
                            <td width="60">輸入<br />方式</td>
                            <td width="60">衡量<br />頻率</td>
                            <td width="60">數值<br />形式</td>
                            <td width="80">數值<br />趨勢</td>
                            @*<td width="60">週期<br />類別</td>*@
                            <td width="80">流程<br />負責人</td>
                            <td width="60">年度</td>
                            <td width="60">年度<br />結果</td>
                            <td width="60">未達標<br />次數</td>
                            <td width="80"></td>
                            @{
                                //月份篩選
                                <!--if (vb_month == "1")
                                {
                                    <td>上年度12月</td>-->
                                    @*<td>狀態</td>*@
                                    <!--<td>差異分析</td>
                                    <td>改善措施</td>
                                    <td>ECD</td>
                                    <td>備註</td>
                                }-->
                                for (int i = 1; i <= 12; i++)
                                {
                                    if (vb_month.IndexOf(',') >= 0 && !vb_month.Split(',').Contains(i.ToString()))
                                    {
                                        //多選
                                        continue;
                                    }
                                    else
                                    {
                                        //單選
                                        if (/*!vb_month.Split(',').Contains((i + 1).ToString()) &&*/ !vb_month.Split(',').Contains(i.ToString()) && vb_month != "0")
                                        {
                                            continue;
                                        }
                                    }
                                    <td>@(i)月</td>
                                    @*<td>狀態</td>*@
                                    <td>差異分析</td>
                                    <td>改善措施</td>
                                    <td>ECD</td>
                                    <td>備註</td>
                                }
                            }
                        </tr>
                    </thead>
                    <tbody>
                        @{
                            int colorIndex = 1;
                            string color;
                            string result_color;
                            //string kpi_result;
                            //string kpi_valueact;
                            int now_month = DateTime.Now.Month;
                            int now_year = DateTime.Now.Year;
                            System.Data.DataRow[] dataRows;
                            System.Data.DataRow[] dataRowsDe;
                            foreach (System.Data.DataRow item in kpiActDataGroup.Rows)
                            {
                                color = colorIndex % 2 == 1 ? "#eff3fb" : "#ffffff";
                                for (int j = 1; j <= 3; j++)
                                {
                                    <tr class="kpiacttr" style="background-color:@color; height: 35px;">
                                        @{
                                            if (j == 1)
                                            {
                                                <td rowspan="3" hidden="hidden">@item["KPI_ID"].ToString()</td>
                                                <td rowspan="3" hidden="hidden">@item["PERIOD_TYPE"].ToString()</td>
                                                <td rowspan="3"><input type="checkbox" class="kpiactdatacheck" aria-label="kpiactdatacheck" onchange="kpidatacheckChange(event)" /></td>
                                                @*<td style="border: 1px solid #507cd1;" rowspan="3">@item["SITE"].ToString()</td>*@
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_YEAR"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_NO"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_DESC"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_TARGET"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_FUNC"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["INPUT_TYPE"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["FREQ_DESC"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["V_FORM_DESC"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["TREND_DESC"].ToString()</td>
                                                @*<td style="border: 1px solid #507cd1;" rowspan="3">@item["CONF_V2"].ToString()</td>*@
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["KPI_OWNER"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["YEARLY_TYPE"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["YEARLY_RESULT"].ToString()</td>
                                                <td style="border: 1px solid #507cd1;" rowspan="3">@item["UNQTY"].ToString()</td>
                                            }

                                            int colNum = 1;
                                            int tdNum = 0;
                                            if (item["PERIOD_TYPE"].ToString() == "M")
                                            {
                                                tdNum = 0;
                                                colNum = 1;
                                            }
                                            else if (item["PERIOD_TYPE"].ToString() == "Q")
                                            {
                                                tdNum = 8;
                                                colNum = 3;
                                            }
                                            else if (item["PERIOD_TYPE"].ToString() == "H")
                                            {
                                                tdNum = 20;
                                                colNum = 6;
                                            }
                                            else if (item["PERIOD_TYPE"].ToString() == "Y")
                                            {
                                                tdNum = 44;
                                                colNum = 12;
                                            }
                                            dataRows = kpiActData.Select("KPI_ID=" + item["KPI_ID"].ToString() + " AND SITE='" + item["SITE"].ToString() + "' AND KPI_YEAR=" + item["KPI_YEAR"].ToString() + " AND KPI_NO=" + item["KPI_NO"].ToString() + " AND PERIOD_TYPE='" + item["PERIOD_TYPE"].ToString() + "'");
                                            for (int i = 1; i <= dataRows.Count(); i++)
                                            {
                                                //行標題
                                                if (i == 1 && j == 1)
                                                {
                                                    <td>Target</td>
                                                    if (vb_month != "0" && item["PERIOD_TYPE"].ToString() != "M")
                                                    {
                                                        <td rowspan="3"></td>
                                                        <td rowspan="3"></td>
                                                        <td rowspan="3"></td>
                                                        <td rowspan="3"></td>
                                                    }
                                                }
                                                else if (i == 1 && j == 2)
                                                {
                                                    <td>Actual</td>
                                                }
                                                else if (i == 1 && j == 3)
                                                {
                                                    <td>判定</td>
                                                }
                                                //月份篩選
                                                //一月份跨年處理
                                                <!--if (vb_month == "1" && i == 1)
                                                {
                                                    dataRowsDe = kpiLastYearDe.Select("KPI_ID=" + item["KPI_ID"].ToString() + " AND SITE='" + item["SITE"].ToString() + "' AND KPI_NO=" + item["KPI_NO"].ToString() + " AND PERIOD_TYPE='" + item["PERIOD_TYPE"].ToString() + "'");
                                                    if (j == 1)
                                                    {
                                                        @*<td>@(dataRowsDe.Count() == 0 ? "" : dataRowsDe[1]["KPI_V2"].ToString())</td>-->*@
                                                        @*@*<td rowspan="3">@(dataRowsDe.Count() ==0 ? "" : dataRowsDe[0]["STATUS_E"].ToString())</td>*@
                                                        @*<!--<td rowspan="3"><textarea rows="4" style="width:@ViewBag.TaWidth;" disabled="disabled">@(dataRowsDe.Count() == 0 ? "" : dataRowsDe[1]["DIFF_ANALYSIS"].ToString())</textarea></td>*@
                                                        @*<td rowspan="3"><textarea rows="4" style="width:@ViewBag.TaWidth;" disabled="disabled">@(dataRowsDe.Count() == 0 ? "" : dataRowsDe[1]["IMPROVE_MEASURE"].ToString())</textarea></td>*@
                                                        @*<td rowspan="3"><input type="date" value="@(dataRowsDe.Count() == 0 ? "" : dataRowsDe[0]["ECD"].ToString())" style="width:100px;" disabled="disabled" /></td>*@
                                                    }
                                                    else if (j == 2)
                                                    {
                                                        if (dataRowsDe.Count() > 0)
                                                        {
                                                            if (dataRowsDe[1]["KPI_RESULT"].ToString() == "1")
                                                            {
                                                                //合格，綠色
                                                                result_color = "#c6efce";
                                                            }
                                                            else if (dataRowsDe[1]["KPI_RESULT"].ToString() == "2")
                                                            {
                                                                //不合格
                                                                if (dataRowsDe[0]["KPI_RESULT"].ToString() == "2")
                                                                {
                                                                    if ((dataRowsDe[1]["TREND_DESC"].ToString() == "越大越好" && Convert.ToInt32(dataRowsDe[1]["KPI_VALUEACT"]) > Convert.ToInt32(dataRowsDe[0]["KPI_VALUEACT"])) || (dataRowsDe[1].ToString() == "越小越好" && Convert.ToInt32(dataRowsDe[1]["KPI_VALUEACT"]) < Convert.ToInt32(dataRowsDe[0]["KPI_VALUEACT"])))
                                                                    {
                                                                        //較上月有進步，黃色
                                                                        result_color = "#ffeb9c";
                                                                    }
                                                                    else
                                                                    {
                                                                        //較上月無進步，紅色
                                                                        result_color = "#ffc7ce";
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    //上月合格本月不合格，紅色
                                                                    result_color = "#ffc7ce";
                                                                }
                                                            }
                                                            else
                                                            {
                                                                result_color = "none";
                                                            }
                                                        }
                                                        else
                                                        {
                                                            result_color = "none";
                                                        }
                                                        @*<td><input type="text" value="@(dataRowsDe.Count() == 0 ? "" : dataRowsDe[1]["KPI_VALUEACT"].ToString())" style="width: 50px; height: 25px; background-color: @result_color;" disabled="disabled" /></td>*@
                                                    }
                                                    else if (j == 3)
                                                    {
                                                        if (dataRowsDe.Count() == 0)
                                                        {
                                                            <td></td>
                                                        }
                                                        else
                                                        {
                                                            @*<td>@dataRowsDe[1]["KPI_RESULT_V"].ToString()</td>*@
                                                        }
                                                    }
                                                }-->
                                                if (vb_month.IndexOf(',') >= 0 && !vb_month.Split(',').Contains((i * colNum).ToString()) && vb_month != "0")
                                                {
                                                    continue;
                                                }
                                                else if (vb_month.IndexOf(',') < 0 && !vb_month.Split(',').Contains((i * colNum).ToString()) /*&& !vb_month.Split(',').Contains((i * colNum + 1).ToString())*/ && vb_month != "0")
                                                {
                                                    continue;
                                                }
                                                if (vb_month != "0")
                                                {
                                                    if (vb_month.IndexOf(',') >= 0 && !vb_month.Split(',').Contains((i * colNum).ToString()))
                                                    {
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                    }
                                                    else if (vb_month.IndexOf(',') < 0 && !vb_month.Split(',').Contains((i * colNum).ToString()) /*&& !vb_month.Split(',').Contains((i * colNum + 1).ToString())*/)
                                                    {
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                    }
                                                }
                                                else
                                                {
                                                    for (int t = 0; t < tdNum; t++)
                                                    {
                                                        <td></td>
                                                    }
                                                }
                                                //行內容
                                                if (j == 1)
                                                {
                                                    <td>@dataRows[i - 1]["KPI_V2"].ToString()</td>
                                                    if (dataRows[i - 1]["IS_LOCK"].ToString() == "N" && (Convert.ToInt32(item["KPI_YEAR"]) == now_year || (Convert.ToInt32(item["KPI_YEAR"]) == now_year - 1 && i * colNum == 12 && now_month == 1)) && (i * colNum == now_month - 1 || (i * colNum == 12 && now_month == 1)))
                                                    {
                                                        @*<td rowspan="3">@dataRows[i - 1]["STATUS_E"].ToString()</td>*@
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)">@dataRows[i - 1]["DIFF_ANALYSIS"].ToString()</textarea></td>
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)">@dataRows[i - 1]["IMPROVE_MEASURE"].ToString()</textarea></td>
                                                        <td rowspan="3"><input type="date" value="@dataRows[i - 1]["ECD"].ToString()" style="width:100px;" onchange="isChange(event)" /></td>
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)">@dataRows[i - 1]["REMARK"].ToString()</textarea></td>
                                                        <td rowspan="3" hidden="hidden">@dataRows[i - 1]["PERIOD_VALUE"].ToString()</td>
                                                    }
                                                    else
                                                    {
                                                        @*<td rowspan="3">@dataRows[i - 1]["STATUS_E"].ToString()</td>*@
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)" disabled="disabled">@dataRows[i - 1]["DIFF_ANALYSIS"].ToString()</textarea></td>
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)" disabled="disabled">@dataRows[i - 1]["IMPROVE_MEASURE"].ToString()</textarea></td>
                                                        <td rowspan="3"><input type="date" value="@dataRows[i - 1]["ECD"].ToString()" style="width:100px;" onchange="isChange(event)" disabled="disabled" /></td>
                                                        <td rowspan="3"><textarea rows="5" style="width:@ViewBag.TaWidth;" onchange="isChange(event)" disabled="disabled">@dataRows[i - 1]["REMARK"].ToString()</textarea></td>
                                                        <td rowspan="3" hidden="hidden">@dataRows[i - 1]["PERIOD_VALUE"].ToString()</td>
                                                    }
                                                }
                                                else if (j == 2)
                                                {
                                                    //if (dataRows[i - 1]["KPI_RESULT"].ToString() == "1")
                                                    //{
                                                    //    //合格，綠色
                                                    //    result_color = "#c6efce";
                                                    //}
                                                    //else if (dataRows[i - 1]["KPI_RESULT"].ToString() == "2")
                                                    //{
                                                    //    if (vb_month == "1" || (vb_month == "0" && i == 1))
                                                    //    {
                                                    //        dataRowsDe = kpiLastYearDe.Select("KPI_ID=" + item["KPI_ID"].ToString() + " AND SITE='" + item["SITE"].ToString() + "' AND KPI_NO=" + item["KPI_NO"].ToString() + " AND PERIOD_TYPE='" + item["PERIOD_TYPE"].ToString() + "'");
                                                    //        if (dataRowsDe.Count() != 0)
                                                    //        {
                                                    //            kpi_result = dataRowsDe[1]["KPI_RESULT"].ToString();
                                                    //            kpi_valueact = dataRowsDe[1]["KPI_VALUEACT"].ToString();
                                                    //        }
                                                    //        else
                                                    //        {
                                                    //            kpi_result = "";
                                                    //            kpi_valueact = "0";
                                                    //        }
                                                    //    }
                                                    //    else
                                                    //    {
                                                    //        kpi_result = dataRows[i - 2]["KPI_RESULT"].ToString();
                                                    //        kpi_valueact = dataRows[i - 2]["KPI_VALUEACT"].ToString();
                                                    //    }
                                                    //    //不合格
                                                    //    if (kpi_result == "2")
                                                    //    {
                                                    //        if ((dataRows[i - 1]["TREND_DESC"].ToString() == "越大越好" && Convert.ToInt32(dataRows[i - 1]["KPI_VALUEACT"]) > Convert.ToInt32(kpi_valueact)) || (dataRows[i - 1]["TREND_DESC"].ToString() == "越小越好" && Convert.ToInt32(dataRows[i - 1]["KPI_VALUEACT"]) < Convert.ToInt32(kpi_valueact)))
                                                    //        {
                                                    //            //較上月有進步，黃色
                                                    //            result_color = "#ffeb9c";
                                                    //        }
                                                    //        else
                                                    //        {
                                                    //            //較上月無進步，紅色
                                                    //            result_color = "#ffc7ce";
                                                    //        }
                                                    //    }
                                                    //    else
                                                    //    {
                                                    //        //上月合格本月不合格，紅色
                                                    //        result_color = "#ffc7ce";
                                                    //    }
                                                    //}
                                                    //else
                                                    //{
                                                    //    result_color = "none";
                                                    //}
                                                    if (dataRows[i - 1]["RESULT_COLOR"].ToString() == "GREEN")
                                                    {
                                                        result_color = "#c6efce";
                                                    }
                                                    else if (dataRows[i - 1]["RESULT_COLOR"].ToString() == "RED")
                                                    {
                                                        result_color = "#ffc7ce";
                                                    }
                                                    else if (dataRows[i - 1]["RESULT_COLOR"].ToString() == "YELLOW")
                                                    {
                                                        result_color = "#ffeb9c";
                                                    }
                                                    else if (dataRows[i - 1]["RESULT_COLOR"].ToString() == "BLANK")
                                                    {
                                                        result_color = "none";
                                                    }
                                                    else
                                                    {
                                                        result_color = "none";
                                                    }
                                                    if (dataRows[i - 1]["IS_LOCK"].ToString() == "N" && (Convert.ToInt32(item["KPI_YEAR"]) == now_year || (Convert.ToInt32(item["KPI_YEAR"]) == now_year - 1 && i * colNum == 12 && now_month == 1)) && (i * colNum == now_month - 1 || (i * colNum == 12 && now_month == 1)))
                                                    {
                                                        <td><input type="text" value="@dataRows[i - 1]["KPI_VALUEACT"].ToString()" style="width: 50px; height: 25px; background-color: @result_color;" onchange="isChange(event)" /></td>
                                                    }
                                                    else
                                                    {
                                                        <td><input type="text" value="@dataRows[i - 1]["KPI_VALUEACT"].ToString()" style="width: 50px; height: 25px; background-color: @result_color;" onchange="isChange(event)" disabled="disabled" /></td>
                                                    }
                                                }
                                                else if (j == 3)
                                                {
                                                    <td>@dataRows[i - 1]["KPI_RESULT_V"].ToString()</td>
                                                }
                                            }
                                        }
                                    </tr>
                                }
                                colorIndex++;
                            }
                        }
                    </tbody>
                    <tfoot>
                        <tr style="background-color:#507cd1; font-size:15px; color: white; height:35px;">
                            <td colspan="20" style="text-align: left; position: sticky; bottom: 0; left: 0; z-index: 2; background-color: #507cd1;">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                第:
                                <span id="pagesIndex">@ViewBag.PagesIndex</span>
                                頁/共:
                                <span>@ViewBag.PagesCount</span>
                                頁
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a style="cursor:pointer;color:white;" onclick="btnKpiSearchClickAct('FP')">首頁</a>
                                <a style="cursor:pointer;color:white;" onclick="btnKpiSearchClickAct('PP')">上一頁</a>
                                <a style="cursor:pointer;color:white;" onclick="btnKpiSearchClickAct('NP')">下一頁</a>
                                <a style="cursor:pointer;color:white;" onclick="btnKpiSearchClickAct('LP')">尾頁</a>
                                轉到第
                                <input id="pagesTo" type="number" value="@ViewBag.PagesIndex" style="height:20px;width:40px;color:black;" />
                                頁
                                <a style="cursor:pointer;color:white;" onclick="btnKpiSearchClickAct('TP')">Go</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                每頁
                                <select id="pagesNum" style="height: 20px; width: 40px; color: black;" onchange="btnKpiSearchClickAct('FP')">
                                    @{
                                        int value = 0;
                                        for (int i = 1; i <= 5; i++)
                                        {
                                            value = i * 10;
                                            if (ViewBag.pagesNum == i * 10)
                                            {
                                                <option value="@value" selected="selected">@value</option>
                                            }
                                            else
                                            {
                                                <option value="@value">@value</option>
                                            }
                                        }
                                    }
                                </select>
                                筆/共
                                <span>@ViewBag.DataNums</span>
                                筆
                                &nbsp;&nbsp;&nbsp;
                            </td>
                            <td colspan="@ViewBag.TfCs" style="text-align: left; position: sticky; bottom: 0; right: 0; z-index: 1; background-color: #507cd1;"></td>
                        </tr>
                    </tfoot>
                </table>
            }
            else
            {
                <h3 style="margin-top:100px;">未查詢到數據！</h3>
            }
        }
    </div>
}